//package com.plian.system.controller.tb;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.plian.Tools.Func;
//import com.plian.Tools.StringPool;
//import com.plian.Tools.base.BaseController;
//import com.plian.Tools.pagedata.PageData;
//import com.plian.system.config.Resubmit;
//import com.plian.system.constant.tb.TripleStatusConstant;
//import com.plian.system.entity.tb.TripleSystem;
//import com.plian.system.model.CommonCode;
//import com.plian.system.model.ListResult;
//import com.plian.system.model.R;
//import com.plian.system.mybatis.search.SearchEntity;
//import com.plian.system.mybatis.search.SearchParamEntiy;
//import com.plian.system.mybatis.search.TokenSearch;
//import com.plian.system.mybatis.support.Condition;
//import com.plian.system.mybatis.support.Query;
//import com.plian.system.service.tb.ITripleMeetingService;
//import com.plian.system.service.tb.ITripleSystemService;
//import com.plian.system.vo.tb.TripleSystemVO;
//import com.plian.system.wrapper.tb.TripleSystemWrapper;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.AllArgsConstructor;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.validation.Valid;
//import java.util.List;
//
///**
// * @Author: Take-off
// * @Description: TODO
// * @Date: 2022/12/23 11:25 AM
// * @Version: 1.0
// **/
//
//@RestController
//@AllArgsConstructor
//@RequestMapping("api/triplesystem")
//@Api(value = "TripleSystemController", tags = "三重一大-委内制度 控制器")
//public class TripleSystemController extends BaseController {
//
//    private final ITripleSystemService tripleSystemService;
//
//    private final TripleSystemWrapper tripleSystemWrapper;
//
//    private final ITripleMeetingService tripleMeetingService;
//
//    @PostMapping("/detail")
//    @ApiOperation(value = "详情", notes = "传入 tripleSystem")
//    public R<TripleSystemVO> detail(@RequestBody TripleSystem tripleSystem) {
//        TripleSystem detail = tripleSystemService.getOne(Condition.getQueryWrapper(tripleSystem));
//        TripleSystemVO tripleSystemVO = tripleSystemWrapper.entityToVO(detail);
//        tripleMeetingService.setSystemMeetDetail(tripleSystemVO);
//        return R.data(tripleSystemVO);
//    }
//
//    @PostMapping("/list")
//    @ApiOperation(value = "分页", notes = "传入query")
//    public ListResult<TripleSystemVO> list(@RequestBody Query query) {
//        List<SearchEntity> entityList = query.getSearch();
//        if (query.getAscs()==null&&query.getDescs()==null){
//            query.setDescs("create_time");
//        }
//        QueryWrapper<TripleSystem> queryWrapper = SearchParamEntiy.getQueryWrapper(
//                Condition.getQueryWrapper(new TripleSystem()), entityList
//        );
//        TokenSearch<TripleSystem> tokenSearch = new TokenSearch<>();
//		tokenSearch.addTokenQuery(queryWrapper, query);
//
//        IPage<TripleSystem> pages = tripleSystemService.page(Condition.getPage(query), queryWrapper);
//        List<TripleSystemVO> tripleSystemVOS = tripleSystemWrapper.entityToVO(pages.getRecords());
//        ListResult<TripleSystemVO> listResult = new ListResult<>(CommonCode.SUCCESS);
//        listResult.setList(tripleSystemVOS);
//        listResult.setTotal(Long.valueOf(pages.getTotal()).intValue());
//        return listResult;
//    }
//
//    @PostMapping("/submit")
//    @Resubmit(delaySeconds = 0)
//    @ApiOperation(value = "新增或修改", notes = "传入 tripleSystem")
//    public R<TripleSystem> submit(@Valid @RequestBody TripleSystem tripleSystem) {
//        boolean result = tripleSystemService.submit(tripleSystem);
//
//        return result ? R.data(tripleSystem) : new R(CommonCode.FAIL);
//    }
//
//    @PostMapping("/remove")
//    @ApiOperation(value = "删除", notes = "传入 ids")
//    public R remove(@RequestBody PageData pd) {
//        List<String> ids = (List<String>)pd.get("ids");
//        return tripleSystemService.deleteLogic(Func.toLongList(StringUtils.join(ids, StringPool.COMMA)))
//                ? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//    }
//
//    @PostMapping("/report")
//    @ApiOperation(value = "上报", notes = "传入 ids")
//    public R report(@RequestBody PageData pd) {
//        List<String> ids = (List<String>)pd.get("ids");
//        return tripleSystemService.changeStatus(Func.toLongList(StringUtils.join(ids, StringPool.COMMA)), TripleStatusConstant.LATER)
//                ? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//    }
//}
